<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      >
    <h:head>
        <meta charset="utf-8"/>
        <title>Solution billeterie</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <meta name="description" content=""/>
        <meta name="author" content=""/>
        <!-- Le styles -->
        <link href="assets/css/bootstrap.css" rel="stylesheet"/>
        <link href="assets/css/main.css" rel="stylesheet"/>
        <link href="assets/css/tek.css" rel="stylesheet"/>
        <style type="text/css">
            body {
                padding-top: 60px;
            }printe
        </style>
        <link href="assets/css/bootstrap-responsive.css" rel="stylesheet" />
        <link rel="shortcut icon" href="assets/ico/favicon.ico"/>
        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png"/>
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png"/>
        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png"/>
        <link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png" />
        <!-- Google Fonts call. Font Used Open Sans -->

    </h:head>
    <h:body>
        <div class="navbar navbar-inverse navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span clasins="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>

                </div>
            </div>
        </div>
        <!-- *********************************************************************************** -->
        <div class="container">
            <!-- CONTENT -->
            <h:form id="form">
                <p:panel  header=""   >
                    <p:panel style="height: 205px;"  header="informations">
                        <h:panelGrid columns="3">
                            <h:outputText  style="margin-left: 10px;font-weight: bold;" value="SN:" /> 
                            <h:inputText  style="margin-left: 10px;font-weight: bold;" value="#{venteBean.sn}" /> 
                            <h:outputText  style="margin-left: 10px;font-weight: bold;" value="" /> 

                            <h:commandButton  style="margin-left: 10px;" styleClass="btn btn-inverse"    value="Enregistrer" action="#{venteBean.enregistrerKit()}"   />
                            <h:commandButton  style="margin-left: 10px;" styleClass="btn btn-inverse"    value="Retour" action="#{venteBean.redirect()}"   /> 
                            <h:commandButton style="margin-left: 10px;" styleClass="btn btn-inverse"  id="lnk" value="Imprimer">  
                                <p:printer target="kk" />  

                            </h:commandButton>  
                        </h:panelGrid>

                        <p:messages   id="messages" showDetail="true" autoUpdate="true"/>  

                    </p:panel>
                    <h:panelGrid   columnClasses="alignTop,alignTop" style="text-align: center;font-size: x-small;width:500px;margin-left: 1%;vertical-align: top;"    columns="2"   >
                        <p:dataTable style="font-size: small;width: 580px;" id="tbl" var="event" value="#{venteBean.evenements}" 
                                     emptyMessage="Aucun Spectacle" 
                                     paginator="true" rows="5"  
                                     >  
                            <f:facet name="header">  
                                Liste Spectacles  
                            </f:facet>  
                            <p:column id="titre"    
                                      headerText="Titre"   
                                      filterMatchMode="contains">  
                                <h:outputText value="#{event.titre}" />  
                            </p:column> 
                            <p:column id="date"    
                                      headerText="Date"   
                                      filterMatchMode="contains">  
                                <h:outputText value="#{event.date}" />  
                            </p:column>

                            <p:column     
                                headerText="Date"   
                                filterMatchMode="contains">  
                                <p:commandButton  value="chaise:#{venteBean.findStock(event)}" action="#{venteBean.ajoutChaise(event)}"  ajax="false"  /> 
                                <p:commandButton  value="gradin:#{venteBean.findStock1(event)}" action="#{venteBean.ajoutGradin(event)}"  ajax="false"  /> 
                            </p:column>

                        </p:dataTable>
                        <h:panelGrid id="kk" columns="1">
                              <h:panelGrid  id="infos" columns="4">
                            <h:outputText style="margin-left: 10px;" value="Nombre billet :" />
                            <h:outputText style="margin-left: 10px;font-weight: bold;" value="#{venteBean.typebsKit.size()}" />
                            <h:outputText  style="margin-left: 10px;" value="Remise :" />
                            <h:outputText  style="margin-left: 10px;font-weight: bold;" value="#{venteBean.remise}%" /> 
                            <h:outputText  style="margin-left: 10px;" value="Prix total :" />
                            <h:outputText  style="margin-left: 10px;font-weight: bold;" value="#{venteBean.prixDeKit} DT" />
                            <h:outputText  style="margin-left: 10px;" value="Prix Achat :" />
                            <h:outputText  style="margin-left: 10px;font-weight: bold;" value="#{venteBean.remiseDeKit} DT" />
                        </h:panelGrid>
                        <p:dataTable  style="font-size: x-small;width: 580px;"  id="tbl1" var="type" value="#{venteBean.typebsKit}" 
                                      emptyMessage="Aucun Spectacle" 
                                      scrollable="true" scrollHeight="600" 
                                      >  
                            <f:facet name="header">  
                                Spectacles choisies  
                            </f:facet>  


                            <p:column id="titre"   
                                      headerText="Titre"   
                                      filterMatchMode="contains">  
                                <h:outputText value="#{type.evenement.titre}" />  
                            </p:column> 
                            <p:column     
                                headerText="Date"   
                                filterMatchMode="contains">  
                                <h:outputText value="#{type.evenement.date}" />  
                            </p:column>
                            <p:column id="date"    
                                      headerText="Modele"   
                                      filterMatchMode="contains">  
                                <h:outputText value="#{type.typeBillet.modele}" />  
                            </p:column>

                            <p:column     

                                filterMatchMode="contains">  
                                <p:commandButton  value="X" action="#{venteBean.remove(type)}"  ajax="false"  /> 
                            </p:column>

                        </p:dataTable>
  
                        </h:panelGrid>
                    
                      
                    </h:panelGrid>
                </p:panel>


                <p:dialog id="modalDialog2"  header=" Ticket Chaise" widgetVar="dlg21" modal="true" height="100">  
                    <h:panelGrid columns="2">
                        <h:outputText value="Nombre billets:" /> 
                        <p:inputMask mask="9" value="#{venteBean.nbrPlaces}"
                                     style="text-align: left;font-size: small;width: 140px;"  />
                        <p:commandButton  value="vendre" action="#{venteBean.vendre2()}" />
                    </h:panelGrid>
                </p:dialog>
                <p:dialog id="modalDialog"  header="Ticket gradins" widgetVar="dlg2" modal="true" height="100">  
                    <h:panelGrid columns="2">
                        <h:outputText value="Nombre billets:" /> 
                        <p:inputMask mask="9" value="#{venteBean.nbrPlaces}"
                                     style="text-align: left;font-size: small;width: 140px;"  />
                        <p:commandButton  value="vendre" action="#{venteBean.vendre()}" />
                    </h:panelGrid>
                </p:dialog>
            </h:form>
        </div><!-- /BlockUnit -->
    </h:body>
</html>